package com.yenlien.traceyun.business.controller;

import com.yenlien.traceyun.business.interceptor.UserAuthUtil;
import com.yenlien.traceyun.business.service.rest.control.ModelCategoryRestService;
import com.yenlien.traceyun.webase.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: bigwangy@sina.com
 * @create: 2020-11-19
 * @description:
 **/

@RestController
@RequestMapping(value = "/model/category")
public class ModelCategoryController extends BaseController {

    @Value("${traceyun.app.id}")
    private String appId;

    @Autowired
    private ModelCategoryRestService modelCategoryRestService;

    /**
     * 加载基源数
     *
     * @return
     */
    @GetMapping(value = "/tree")
    public Object loadTree() {
        return modelCategoryRestService.loadTree(UserAuthUtil.getLoginUser().getCompanyId());
    }
}
